package com.qef.com.mmovie.presenter;


import com.orhanobut.logger.Logger;
import com.qef.com.mmovie.api.VideoListBean;
import com.qef.com.mmovie.entity.SubscriptionDetailsEntity;
import com.qef.com.mmovie.mvp.interactor.SubscriptionDetailsInteractor;
import com.qef.com.mmovie.mvp.interactor.VideoInteractor;
import com.qef.com.mmovie.net.IGetDataDelegate;
import com.qef.com.mmovie.presenter.contract.SubscriptionDetailsContract;
import com.qef.com.mmovie.presenter.contract.VideoHomeContract;

import javax.inject.Inject;

import io.reactivex.disposables.Disposable;


/**
 * Created by qianenfan on 17/2/24.
 */

public class SubscriptionDetailsPresenter extends RxPresenter<SubscriptionDetailsContract.View> implements SubscriptionDetailsContract.Presenter {
    //    private KyApiService mRetrofitHelper;
    @Inject
    SubscriptionDetailsInteractor videoInteractor;

    @Inject
    public SubscriptionDetailsPresenter() {
    }

    @Override
    public void getVideoData(int start, int num) {
        Disposable disposable = videoInteractor.loadPlayList(start, num, new IGetDataDelegate<SubscriptionDetailsEntity>() {
            @Override
            public void getDataSuccess(SubscriptionDetailsEntity infoEntity) {
                mView.showContent(infoEntity);
                Logger.i(infoEntity.toString());
            }

            @Override
            public void getDataError(Throwable throwable) {
                mView.error(throwable);
                Logger.i("xxxxxxxx");
            }
        });

        addSubscrebe(disposable);
    }

}
